﻿using System;
using System.Collections.Generic;
using ControleRepresentante.Logic.Models;
using ControleRepresentante.Logic.Repositories;

namespace ControleRepresentante.UnitTests.Mocks
{
    class MockRepository : IUsuariosHolderRepository<MockModel, MockStatistics>
    {
        private readonly MockModel m_MockModel;

        public MockRepository(MockModel mockModel)
        {
            m_MockModel = mockModel;
        }

        public Guid LastGetModelById { get; private set; }
        public Guid LastRemoveModelById { get; private set; }
        public int LastPage { get; private set; }

        public IEnumerable<MockModel> GetModels(out MockStatistics statistics, int page = -1)
        {
            LastPage = page;
            statistics = new MockStatistics();
            return new[] {m_MockModel};
        }

        public void AddModel(MockModel model)
        {
            throw new NotImplementedException();
        }

        public MockModel GetModelById(Guid id)
        {
            LastGetModelById = id;
            return m_MockModel;
        }

        public void UpdateModel(MockModel model)
        {
            throw new NotImplementedException();
        }

        public void RemoveModelById(Guid id)
        {
            LastRemoveModelById = id;
        }

        public int PageSize
        {
            get { return 50; }
        }

        public User User { get; set; }

        public Representante GetRepresentante()
        {
            return Representante;
        }

        public Representante Representante { get; set; }

        public IEnumerable<string> SearchCidades(string cidade)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<string> SearchBairros(string bairro)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<MockModel> GetModelsByIds(IEnumerable<Guid> ids)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<string> SearchAttribute(Guid id, string text, AttributeType type)
        {
            throw new NotImplementedException();
        }

        public Dictionary<Guid, string> GetModelNames()
        {
            throw new NotImplementedException();
        }

        public Dictionary<Guid, string> GetModelNames(string search)
        {
            throw new NotImplementedException();
        }
    }
}